#include <iostream>
using namespace std;

class Animal
{
public:
    Animal()
    {
        cout << "Animal" << endl;
    }
    void eat()
    {
        cout << "Animal eat" << endl;
    }
};

class Catamount : virtual public Animal
{
public:
    Catamount()
    {
        cout << "Catamount" << endl;
    }
    void eat()
    {
        cout << "catamount eat" << endl;
    }

private:
    int a;
};

class Mammal : virtual public Animal
{
public:
    Mammal()
    {
        cout << "Mammal" << endl;
    }
    void eat()
    {
        cout << "mammal eat" << endl;
    }

private:
    float b;
};

class Cat : virtual public Catamount, virtual public Mammal
{
public:
    Cat()
    {
        cout << "Cat" << endl;
    }
    void eat()
    {
        cout << "cat eat" << endl;
    }
};

int main()
{
    cout << sizeof(Cat) << endl;       // 40  2个指针 2个虚函数指针 int a float b
    cout << sizeof(Catamount) << endl; // 16  指针 int a
    cout << sizeof(Mammal) << endl;    // 16  指针 float b
    cout << sizeof(Animal) << endl;    // 1

    return 0;
}